﻿using System;
using System.ComponentModel.DataAnnotations;
using WeBlog.Interfaces;

namespace WeBlog.Models
{
    public class PostRating : IModel
    {
        [Key]
        public int PostRatingId { get; set; }
        [Required]
        public int PostId { get; set; }

        [ForeignKey("UserId")]
        public virtual User User { get; set; }
        public int? UserId { get; set; }

        [Required]
        public DateTime DateTime { get; set; }

        [StringLength(15)]
        public string IpAddress { get; set; }

        [Required]
        public float Rating { get; set; }        
    }
}
